import { HTTP } from '../utils/request';
const http = new HTTP();

// 查询车辆信息
export function queryTravelVehicleInfo({id,classificationId,name,tag,isHot,vehicleIds,page,size = 10,sort = 'sort',order}){
  return http.request({
    url: '/app/query/travel/vehicle/info',
    data: {
      'brandId': global.brandId,
      'id': id,
      'classificationId': classificationId, // 分类ID
      'name': name, // 车辆名称
      'tag': tag, // 标签
      'isHot': isHot, // 是否热门，1：是，0：否
      'vehicleIds': vehicleIds, // 车辆ID，多个用逗号隔开
      'sort': sort,
      'order': order,
      'page': page,
      'size': size,
    }
  })
}

// 查询车辆图片
export function queryTravelVehiclePic({id,vehicleId,type,page,size = 10}){
  return http.request({
    url: '/app/query/travel/vehicle/picture',
    data: {
      'brandId': global.brandId,
      'id': id,
      'vehicleId': vehicleId, // 车辆ID
      'type': type, // 类型(0:详情图,1:轮播图)
      'page': page,
      'size': size,
    }
  })
}

// 查询车辆详情
export function queryTravelVehicleDetail({id,vehicleId,name,description,type}){
  return http.request({
    url: '/app/query/travel/vehicle/details',
    data: {
      'brandId': global.brandId,
      'id': id,
      'vehicleId': vehicleId, // 车辆ID
      'name': name, // 名称
      'description': description, // 描述
      'type': type, // 类型(0:基本信息,1:配置信息)
    }
  })
}

// 查询车辆参数标题
export function queryTravelVehicleParamTitle({id,name,page,size = 10}){
  return http.request({
    url: '/app/query/travel/vehicle/param/title',
    data: {
      'brandId': global.brandId,
      'id': id,
      'name': name, // 姓名
      'sort': 'sort',
      'page': page,
      'size': size,
    }
  })
}

// 查询车辆参数内容
export function queryTravelVehicleParamCont({id,titleId,name,page,size = 10}){
  return  http.request({
    url: '/app/query/travel/vehicle/param/content',
    data: {
      'brandId': global.brandId,
      'id': id,
      'titleId': titleId, // 标题ID
      'sort': 'sort',
      'name': name, // 姓名
      'page': page,
      'size': size,
    }
  })
}

// 查询车型分类
export function queryTravelVehicleClassify({id,name,isHot,page,size = 10}){
  return http.request({
    url: '/app/query/travel/vehicle/classification',
    data: {
      'brandId': global.brandId,
      'id': id,
      'name': name, // 名称
      'isHot': isHot, // 是否热门，1：是，0：否
      'sort': 'sort',
      'page': page,
      'size': size,
    }
  })
}

// 查询车辆品牌
export function queryTravelVehicleMake({id,name,isHot}){
  return http.request({
    url: '/app/query/travel/vehicle/make',
    data: {
      'brandId': global.brandId,
      'id': id,
      'name': name, // 名称
      'isHot': isHot, // 是否热门，1：是，0：否
    }
  })
}

// 查询车辆参数配置
export function queryTravelVehicleParamConfig({id,vehicleId,paramTitleId,paramContentId}){
  return http.request({
    url: '/app/query/travel/vehicle/param/config',
    data: {
      'brandId': global.brandId,
      'id': id,
      'vehicleId': vehicleId, // 车辆ID
      'paramTitleId': paramTitleId, // 参数标题ID
      'paramContentId': paramContentId, // 参数内容ID
    }
  })
}

// 根据参数内容ID筛选查询车辆ID
export function queryTravelVehicleIdByParamContId({paramContentIds}){
  return http.request({
    url: '/app/query/travel/vehicle/id/by/param/content/id',
    data: {
      'paramContentIds': paramContentIds, // 参数内容ID
    }
  })
}

// 查询租车门店
export function queryTravelVehicleStore({id,name,province,city,area,town,page,size = 10}){
  return http.request({
    url: '/app/query/travel/vehicle/store',
    data: {
      'brandId': global.brandId,
      'id': id,
      'name': name, // 门店名称
      'province': province, // 省份
      'city': city,
      'area': area,
      'town': town,
      'page': page,
      'size': size,
    }
  })
}

// 查询租车门店配置
export function queryTravelVehicleStoreConfig({id,vehicleId,storeId}){
  return http.request({
    url: '/app/query/travel/vehicle/store/config',
    data: {
      'brandId': global.brandId,
      'id': id,
      'vehicleId': vehicleId, // 车辆ID
      'storeId': storeId, // 门店ID
    }
  })
}

// 查询租车商家保障
export function queryTravelVehicleSafeguard({id,name}){
  return http.request({
    url: '/app/query/travel/vehicle/safeguard',
    data: {
      'brandId': global.brandId,
      'id': id,
      'name': name, // 保障名称
    }
  })
}

// 查询租车商家保障配置
export function queryTravelVehicleSafeConfig({id,vehicleId,storeId,safeguardId,isDefault}){
  return http.request({
    url: '/app/query/travel/vehicle/safeguard/config',
    data: {
      'brandId': global.brandId,
      'id': id,
      'vehicleId': vehicleId, // 车辆ID
      'storeId': storeId, // 门店ID
      'safeguardId': safeguardId, // 保障ID
      'isDefault': isDefault, // 是否默认，1：是，0：否
      'sort': 'sort'
    }
  })
}

// 查询租车详情
export function queryTravelVehicleRentalDetails({vehicleId,startTime,endTime}){
  return http.request({
    url: '/app/query/travel/vehicle/rental/details',
    data: {
      'brandId': global.brandId,
      'vehicleId': vehicleId, // 车辆ID
      'startTime': startTime, // 开始时间
      'endTime': endTime, // 结束时间
    }
  })
}

// 查询租车门店详情
export function queryTravelVehicleStoreDetails({storeConfigId,safeguardConfigIds,startTime,endTime}){
  return http.request({
    url: '/app/query/travel/vehicle/store/details',
    data: {
      'storeConfigId': storeConfigId, // 门店配置ID
      'safeguardConfigIds': safeguardConfigIds, // 额外商家保障ID（多个用逗号隔开）
      'startTime': startTime, // 开始时间
      'endTime': endTime, // 结束时间
    }
  })
}

// 提交租车订单
export function submitTravelVehicleRentalOrderForm({storeConfigId,safeguardConfigIds,startTime,endTime,message,pickUpLocation,giveBackLocation,driverName,driverIdCard,driverPhone}){
  return http.request({
    url: '/app/submit/travel/vehicle/rental/order/form',
    data: {
      'storeConfigId': storeConfigId, // 门店配置id
      'safeguardConfigIds': safeguardConfigIds, // 额外商家保障id（多个用逗号隔开）
      'startTime': startTime, // 开始时间
      'endTime': endTime, // 结束时间
      'message': message, // 买家留言
      'pickUpLocation': pickUpLocation, // 取车地点
      'giveBackLocation': giveBackLocation, // 还车地点
      'driverName': driverName, // 驾驶人姓名
      'driverIdCard': driverIdCard, // 驾驶人身份证号
      'driverPhone': driverPhone, // 驾驶人手机号
    }
  })
}